<template>
  <div class="h100 commonTableSty" >
    <s-table
      ref="table"
      class="h100"
      :columns="columns"
      :data="loadData"
      :row-key="(record,index)=>index"
    >
      <template
        slot-scope="text"
        v-for="column in commonColumns"
        :slot="column.scopedSlots.customRender"
      >
        <table-ellipsis :text="text || '-'" :key="column.dataIndex"></table-ellipsis>
      </template>
      <template
        slot-scope="text"
        slot="success"
      >
        <table-ellipsis :text="text?$t('success'):$t('fail')" ></table-ellipsis>
      </template>
    </s-table>
  </div>
</template>
<script>
import { failFileTbColumns } from '../config/list'
import tableEllipsis from '@/components/Ellipsis/TableEllipsis'
import { STable } from '@/components'
import orderManagementApi from '@/api/modules/system/orderManagement'
export default {
  components: {
    tableEllipsis,
    STable
  },
  props: {
    pretreatmentId: {
      type: String,
      default: ''
    }
  },
  computed: {
    commonColumns () {
      return this.columns.filter(item => !item.special)
    }
  },
  data () {
    return {
      columns: failFileTbColumns
    }
  },
  watch: {
  },
  created () {
  },
  mounted () {
  },
  methods: {
    loadData (parameter) {
      const params = { ...{ pretreatmentId: this.pretreatmentId }, ...parameter }
      return orderManagementApi.uploadBgServiceOrderFileFail(params)
    }
  }
}
</script>
